#! /usr/bin/perl -w

use Data::Dumper;
use List::Util qw( first );

my $name = "qinxiaohui";
my $name2 = "qinxiaohui2";

my %names = ('key1'=>$name,'key2'=>$name2);

for my $a_name (values %names) {
    print "-$a_name-\n";
}

print "-----------after------------\n";

&test_sub(\%names);

for my $a_name (values %names) {
    print "-$a_name-\n";
}

sub test_sub {
    my ($hash) = @_;
    for my $key (keys $hash) {
        my $val = \($hash->{$key});
        print "========$key====$$val=======\n";
        $$val = "zzzzzzzzzzz";
    }
    $hash->{'key3'} = "3333333";
    $hash->{'key4'} = "44444444";
}

sub test_sub3 {
    my ($hash) = @_;
    for my $a_name (values $hash) {
        print "====before:$a_name after:Ulric=====\n";
        $a_name = 'Ulric';
    }
}

sub test_sub1 {
    for my $name ( @_ ) {
        $name = "Ulric";
    }
}

sub test_sub2 {
    my ($name) = @_;
    $name = "Ulric";
}


print '-' x 90;
print "\n";

my @arr = (1, 2, 3, 4, 5);
my @first = grep { $_ > 3 } @arr;
print "@first\n";

print '-' x 90;
print "\n";

unless ($xx) {
    print "xxxxxxxxx\n";
}
else {
    print "nnnnnnnnnnn\n";
}

map { $_ = $_ + 10 } @arr;
print "@arr\n";



